package com.jwm.model;

import org.apache.commons.lang3.StringUtils;

/**
 * @author 崔洁
 */

public enum CmdEnum {
    start("start"),
    stop("stop"),
    restart("restart"),
    nginxQuery("nginxQuery"),
    nginxEdit("nginxEdit"),
    nginxReload("nginxReload");
    private final String label;

    CmdEnum(String label) {
        this.label = label;
    }

    public String getLabel() {
        return label;
    }

    public static CmdEnum valueOfLabel(String label) {
        for (CmdEnum obj : CmdEnum.values()) {
            if (java.util.Objects.equals(obj.label, label)) {
                return obj;
            }
        }
        if (StringUtils.isEmpty(label)) {
            return null;
        }
        return null;
    }
}
